﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KPI.OrganizationDomain.Model.Entity;
using KPI.Utility;

namespace KPI.OrganizationDomain.Infrastructure.DbObject
{
    public class EmployeeLevelTab : EntityBase
    {
        public int EmployeeLevelID;
        public string Name;
        public string Description;

        public decimal BasicAnnualSalary;
        public decimal MonthlyTelephoneFee;
        public decimal MonthlyOilFee;

        public int AnnualLeaveDay;
        public int PayedSickLeaveDay;

        public EmployeeLevelTab()
        { }

        public EmployeeLevelTab(EmployeeLevel levelTabDto)
        {
            this.EmployeeLevelID = levelTabDto.EmployeeLevelID;
            this.AnnualLeaveDay = levelTabDto.AnnualLeaveDay;
            this.BasicAnnualSalary = levelTabDto.BasicAnnualSalary;
            this.Description = levelTabDto.Description;
            this.MonthlyOilFee = levelTabDto.MonthlyOilFee;
            this.MonthlyTelephoneFee = levelTabDto.MonthlyTelephoneFee;
            this.Name = levelTabDto.Name;
            this.PayedSickLeaveDay = levelTabDto.PayedSickLeaveDay;

            this.LastModifiedDate = levelTabDto.LastModifiedDate;
            this.Version = levelTabDto.Version;
            this.IsDeleted = levelTabDto.IsDeleted;
            this.CreatedDate = levelTabDto.CreatedDate;
        }

        public static EmployeeLevel FillEmployeeLevel(EmployeeLevelTab levelTab, EmployeeLevel LevelDto)
        {
            LevelDto.EmployeeLevelID = levelTab.EmployeeLevelID;
            return levelTab.Copy<EmployeeLevel>(LevelDto);
        }
    }
}
